package com.hospital.doctor.doctorg.service.impl;

import com.hospital.doctor.doctorg.dao.TotalbillDao;
import com.hospital.doctor.doctorg.service.Totalbillservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 业务层
 */
@Service
public class TotalbillServiceImpl implements Totalbillservice {

    @Autowired
    private TotalbillDao totalbillDao;

    //得到检查的总费用
    @Override
    public Double checkcost() {
        Double check = totalbillDao.checkcost();
        if (check == null) {
            return 0.0;
        } else {
            return check;
        }
    }

    //得到挂号的费用
    @Override
    public Double guahaocost() {
        Double guaHao = totalbillDao.guahaocost();
        if (guaHao == null) {
            return 0.0;
        } else {
            return guaHao;
        }
    }

    //得到药品的总价
    @Override
    public Double drugcost() {
        Double drug = totalbillDao.drugcost();
        if (drug == null) {
            return 0.0;
        } else {
            return drug;
        }
    }

}
